/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.bld.modulo.web.bean.cliente;

import br.com.bld.model.municipio.MunicipioBe;
import java.io.Serializable;
import java.sql.SQLException;
import java.util.Collection;
import javax.enterprise.context.SessionScoped;
import javax.faces.bean.ManagedBean;
import javax.inject.Named;

/**
 *
 * @author Pedro
 */
@Named(value = "anterClienteSessionBean")
@ManagedBean
@SessionScoped
public class ManterClienteSessionBean implements Serializable {
   
    private Collection<String> collUf = null;
    private Collection<String> collCidade = null;
    private String erro;
    /**
     * @return the collUf
     */
    public Collection<String> getCollUf() {
        
        try {
            MunicipioBe be = new MunicipioBe();
            
            collUf = be.selecionarUF();
            
        } catch(SQLException e) {
            StringBuilder str = new StringBuilder();
            
            str.append(e.getMessage());
            for(StackTraceElement s: e.getStackTrace()) {
                str.append(s.toString()).append("\n");
            }
            
            setErro(str.toString());
        }
        
        return collUf;
    }

    /**
     * @param collUf the collUf to set
     */
    public void setCollUf(Collection<String> collUf) {
        
        this.collUf = collUf;
    }

    /**
     * @return the erro
     */
    public String getErro() {
        return erro;
    }

    /**
     * @param erro the erro to set
     */
    public void setErro(String erro) {
        this.erro = erro;
    }

    /**
     * @return the collCidade
     */
    public Collection<String> getCollCidade() {
        return collCidade;
    }

    /**
     * @param collCidade the collCidade to set
     */
    public void setCollCidade(Collection<String> collCidade) {
        this.collCidade = collCidade;
    }
}
